<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>后台管理</title>
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="css/font.css">
		<link rel="stylesheet" href="css/index.css">
		<link rel="stylesheet" href="layui/css/layui.css" />
		<style type="text/css">
		.layui-tab-title li .layui-tab-close{
			display:none;
		}
		.navacolor{
			color:#148cf1;
		}
		</style>
	</head>
	<body>
		<!-- 顶部开始 -->
		<div class="container">
			<div class="logo">
				<a href="../html/index.jsp">后台管理端</a>
			</div>
			<div class="left_open">
				<i title="展开左侧栏" class="iconfont">&#xe68e;</i>
			</div><div>
			<ul class="layui-nav left fast-add" lay-filter=""></ul>
			<ul class="layui-nav right" lay-filter="">
				<li class="layui-nav-item">
					
					<a href="javascript:;">
						<span id="userrole">用户:${loginuser.realname}</span>&nbsp;&nbsp;&nbsp;&nbsp;
					</a>
					<dl class="layui-nav-child">
						<dd>
							<button type="button" class="layui-btn layui-bg-gray" id="modifydata" lay-event="modifydata" lay-filter="modifydata" style="width: 100%">个人资料</button>
						</dd>
						<dd>
							<button type="button" class="layui-btn layui-bg-gray" id="modifypwd" lay-event="modifypwd" lay-filter="modifypwd" style="width: 100%">修改密码</button>
						</dd>
						<dd>
							<button type="button" class="layui-btn layui-bg-gray" id="loginout" lay-event="loginout" lay-filter="loginout" style="width: 100%">退出系统</button>
						</dd>
					</dl>
				</li>
			</ul>
		</div>
		<!-- 顶部结束 -->
		
		<!-- 中部开始 -->
		<!-- 左侧菜单开始 -->
		<div class="left-nav" style="overflow-x: hidden; width:200px;">
			<div id="side-nav" style="overflow-x: hidden;height:100%">
				<ul id="nav">	
				</ul>
			</div>
		</div>
		<!-- 左侧菜单结束 -->
		
		<!-- 右侧主体开始 -->
		<div class="page-content">
			<div class="layui-tab tab" lay-filter="wenav_tab" id="WeTabTip" lay-allowclose="true">
				<ul class="layui-tab-title" id="tabName">
					<li id="liformtitle">我的桌面</li>
				</ul>
				<div class="layui-tab-content">
					<div class="layui-tab-item layui-show">
						<iframe id="ifram1" src="index.jsp" frameborder="0" scrolling="yes" class="weIframe"></iframe>
					</div>
				</div>
			</div>
		</div>
		<!-- 右侧主体结束 -->
		<!-- 中部结束 -->
		
		<!-- 底部开始 -->
		<div class="footer">
			<center>
			<div class="copyright">Copyright ©2018 云南工商学院.软件技术</div>
			</center>
		</div>
		<!-- 底部结束 -->
		
		<script src="./layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="./layui/layui.all.js" charset="utf-8"></script>
		<script type="text/javascript" src="./js/jquery-3.3.1.js" ></script>
		<script type="text/javascript" src="./js/admin.js" ></script>
			<script>
	layui.use([ 'table', 'form', 'layer', 'laydate', 'laytpl', 'element' ], function() {
		var table = layui.table, form = layui.form, 
			layer = layui.layer, $ = layui.jquery,
			laydate = layui.laydate, laytpl = layui.laytpl,
			element = layui.element;

		/*
		 *查看个人资料
		*/
		$("#modifydata").click(function(){
			layer.open({
	          type: 2
	          ,title: '个人资料查看'
	          ,content: 'queryUserDate.jsp'
	          ,maxmin: true
	          ,area: ['500px', '420px']
	          /* ,btn: ['确定', '取消'] */
	          ,yes: function(index, layero){
	            //点击确认触发 iframe 内容中的按钮提交
		            var submit = layero.find('iframe').contents().find("#layuiadmin-app-form-submit");
		            submit.click();
	         	 }
	        }); 
		})
		
		/*
		 *修改密码loginout
		*/
		$("#modifypwd").click(function(){
			layer.open({
	          type: 2
	          ,title: '个人资料'
	          ,content: 'updatepwd.jsp'
	          ,maxmin: true
	          ,area: ['500px', '420px']
	          ,btn: ['确定', '取消']
	          ,yes: function(index, layero){
	            //点击确认触发 iframe 内容中的按钮提交
		            var submit = layero.find('iframe').contents().find("#layuiadmin-app-form-submit");
		            submit.click();
	         	 }
	        }); 
		})
		
		
		/*
		 *退出登录
		*/
		$("#loginout").click(function(){
			$.ajax({
				url:"../loginmana/loginout",
				type:"POST",
				data:null,
				dataType : "json",
				xhrFields :{
					withCredentials: true
				},
				contentType:'application/json;charset=UTF-8',
				success:function(e){
					if(e.code == 0){
						layer.msg(e.msg,{icon:6}); 
						setTimeout("javascript:location.href='login2.jsp'", 0);
					}else{
						layer.msg(e.msg,{icon:5});
						return;
					}
					
				},
				error:function(e){
					layer.msg("添加失敗",{icon:5});
					
				}
			})
      	return false;
		})
});
	
	</script>
	</body>
</html>